<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新闻列表管理</title>
<script language="javascript">
	function selectAll()
	{
		var arrObj = document.all;
		for ( var i = 0; i < arrObj.length; i++)
		{
			if (typeof arrObj[i].type != "undefined"
					&& arrObj[i].type == 'checkbox')
				arrObj[i].checked = true;
		}
	}
	function unSelectAll()
	{
		var arrObj = document.all;
		for ( var i = 0; i < arrObj.length; i++)
		{
			if (typeof arrObj[i].type != "undefined"
					&& arrObj[i].type == 'checkbox')
				arrObj[i].checked = false;
		}
	}
</script>
<style type="text/css">
body {
	font:12px Arial, Helvetica, sans-serif;
	color: #000;
	background-color: #EEF2FB;
	margin: 0px;
}
table.default {
	background: #C1DCF7 none repeat scroll 0%;
	border: 1px solid #C1DCF7;
	color: #000000;
	width: 98%;
	border-collapse: collapse;
	margin: 0 auto;
}
table.default caption {
	background:transparent url(images/bg_list.gif) repeat-x scroll 0%;
	height: 30px !important;
	line-height: 30px;
	text-align: left;
	padding-left: 10px;
	font-size: 14px;
	font-weight: bold;
	color: #FFFFFF;
}
table.default caption a:link, table.default caption a:visited {
	color: #000000;
	font-size: 12px;
	text-decoration: underline;
}
table.default caption a:hover {
	font-size: 12px;
	color: #14568A;
}
table.default thead tr {
	background: #C1DCF7 none repeat scroll 0%;
	color: #000000;
	height: 25px;
	line-height: 25px;
	text-align: center;
	font-size: 13px;
}
table.default thead tr th {
	border-color: #C1DCF7;		/* fix for IE */
}
table.default tbody {
	background: #FFFFFF none repeat scroll 0%;
	text-align: left;
}
table.default tbody tr {
	height: 25px;
	line-height: 25px;
	event: expression(
		(this.onmouseover = function() {this.className += ' over';}) &&
		(this.onmouseout = function() {this.className = this.className.replace(' over', '');})
	);
}
table.default tbody tr:hover, table.default tbody tr.over {
	background-color: #E8F0FF;
}
table.default tbody tr td {
	font-size: 12px;
	padding: 0 0 0 5px;
	border-color: #C1DCF7;		/* fix for IE */
}
table.default tbody tr td {	/* fix for IE when align="center" or align="right" */
	padding-left: expression(
		(((this.align == 'center') || (this.align == 'right')) ? '0px' : '5px')
	);
	padding-right: expression(
		((this.align == 'right') ? '5px' : '0px')
	);
}
table.default tbody tr td[align="center"] {
	padding: 0;
}
table.default tbody tr td[align="right"] {
	padding: 0 5px 0 0;
}
* a{
	text-decoration: none;
}
</style>
</head>


	<body>
	<form name="form1" method="post" action="">
	<table class="default" cellpadding="1" cellspacing="0" rules="all">
	<caption><center>管理新闻列表</center></caption>
	<thead>
		<tr>
			<th width="5%">选择</th>
			<th width="5%">新闻ID</th>
			<th width="30%">新闻标题</th>
			<th width="10%">新闻类型</th>
			<th width="20%">发表日期</th>
			<th width="10%">点击率</th>
			<th width="20%">操     作</th>
		</tr>
	</thead>
	<tbody>
	<s:iterator value="news" var="news">
		<tr>
			<td align="center"><input type='checkbox'  name='selid[]' id='selid[]' value='<s:property value="#news.newsId"/>'></td>
			<td align="center"><s:property value="#news.newsId" /></td>
			<td align="center"><s:if test="%{#news.newsName.length()>23}"><s:property value="#news.newsName.substring(0,23)+'...'"/></s:if><s:else><s:property value="#news.newsName"/></s:else></td>
			<td align="center"><s:property value="#news.newsType" /></td>
			<td align="center"><s:property value="#news.newsDate" /></td>
			<td align="center"><s:property value="#news.newsHot" /></td>
			<td align="center"><a href="newsAction!listByIdBack.action?newsId=<s:property value="#news.newsId" />&newsItem=<s:property value="#news.newsItem" />">
			<img src="images/edit.gif" border="0" alt='编辑' title='编辑'>&nbsp;编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="newsAction!delById.action?newsId=<s:property value="#news.newsId" />&newsItem=1&page=${page}&pageSize=20" onclick="return confirm('确定删除该条记录吗？')"><img src="images/delete.gif" border="0" alt='删除' title='删除'>&nbsp;删除</a></td>
		</tr>
	</s:iterator>
	</tbody>
</table>
<br>
			<div style="float: right; padding-right: 15px;">
				<table border="0" cellpadding="0" cellspacing="0">
					<tbody>
						<tr>
							<td>
								<a href="#unexist" onclick="selectAll();">全选</a> | <a href="#unexist" onclick="unSelectAll();">清除选择</a>&nbsp;&nbsp;&nbsp;&nbsp;
							</td>
							<td>
								<s:if test="prePage!=0"><a href="newsAction!listNewsByPage.action?newsItem=1&page=${startPage}&pageSize=20">首页 </a>
								</s:if>
								<s:else>首页	</s:else>
							</td>
							<td>
								<s:if test="prePage!=0">
									<a
										href="newsAction!listNewsByPage.action?newsItem=1&page=${prePage}&pageSize=20">
										&nbsp;&nbsp;上一页 </a>
								</s:if>
								<s:else>&nbsp;&nbsp;上一页	</s:else>
							</td>
							<td>
								<s:if test="nextPage!=0">
									<a
										href="newsAction!listNewsByPage.action?newsItem=1&page=${nextPage}&pageSize=20">
										&nbsp;&nbsp;下一页 </a>
								</s:if>
								<s:else>&nbsp;&nbsp;下一页</s:else>
							</td>
							<td>
								<s:if test="endPage!=0">
									<a href="newsAction!listNewsByPage.action?newsItem=1&page=${endPage}&pageSize=20">
										&nbsp;&nbsp;末页 </a>
								</s:if>
								<s:else>&nbsp;&nbsp;末页</s:else>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</form>
</body>
</html>

